package com.hadoop.project;

import com.hadoop.project.utils.GenCode;
import com.hadoop.project.utils.QQEmailUtil;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

import static com.hadoop.project.entity.constant.QQConstant.EmailContent;

@SpringBootTest
public class testutil {

    // 测试发送邮件
    @Test
    public void testEmail() throws Exception {
//        String toEmail = "haogege244aaa@2925.com";
        String toEmail = "3124253487@qq.com";
        String code = GenCode.getCode(6);

        QQEmailUtil.sendEmail(toEmail, code, EmailContent);
    }

    // 测试生成随机验证码
    @Test
    public void testgocode() {
        System.out.println(GenCode.getCode(10));
    }
}
